package com.utcs.modules.resource.basic.entity;

import com.utcs.common.persistence.TreeEntity;

import java.io.Serializable;

/**
 * Created by Fly on 2017/5/23.
 * 部门实体类
 */
public class Department extends TreeEntity<Department>{

    private static final long serialVersionUID = 1L;

    private String code;
    /**
     * jackson中的@JsonBackReference和@JsonManagedReference，以及@JsonIgnore均是为了解决对象中存在双向引用导致的无限递归（infinite recursion）问题。这些标注均可用在属性或对应的get、set方法中
     * @return
     */
    public Department getParent() {
        return parent;
    }

    /**
     * 父对象，只能通过子类实现，父类实现mybatis无法读取
     * @param parent
     * @return
     */
    public void setParent(Department parent) {
        this.parent = parent;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return "Department{" +
                "parent=" + parent +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", code='" + code + '\'' +
                ", createBy=" + createBy +
                ", createDate=" + createDate +
                ", updateBy=" + updateBy +
                ", updateDate=" + updateDate +
                ", description='" + description + '\'' +
                ", showSign=" + showSign +
                '}';
    }
}
